import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity("device_setting_attr", { schema: "charge" })
export class DeviceSettingAttr {
  @PrimaryGeneratedColumn({ type: "int", name: "id", unsigned: true })
  id: number;

  @Column("varchar", { name: "name", length: 60 })
  name: string;

  @Column("varchar", { name: "key", comment: "字段名", length: 20 })
  key: string;

  @Column("varchar", { name: "type", comment: "数据类型", length: 10 })
  type: string;

  @Column("varchar", { name: "unit", comment: "单位", length: 20 })
  unit: string;

  @Column("varchar", { name: "remark", length: 100 })
  remark: string;

  @Column("text", { name: "func", nullable: true })
  func: string | null;

  @Column("int", { name: "create_time", unsigned: true, default: () => "'0'" })
  createTime: number;

  @Column("int", { name: "update_time", unsigned: true, default: () => "'0'" })
  updateTime: number;
}
